package io.gitee.tziye.core.kv.model;

import io.gitee.tziye.RenaiClient;
import io.gitee.tziye.core.kv.RenaiKey;
import io.gitee.tziye.enums.KvType;

public abstract class RenaiKVBase<T> {

    protected final RenaiClient renaiClient;
    protected final KvType type;
    public final String key;
    public final Class<T> clazz;

    public RenaiKVBase(RenaiClient renaiClient, String key, Class<T> clazz, KvType type) {
        this.renaiClient = renaiClient;
        this.key = key;
        this.clazz = clazz;
        this.type = type;
    }

    public abstract RenaiKey key();

    public abstract void expire(int expireSeconds);

    public abstract boolean exists();

    public abstract boolean delete();

}
